<!--
 * @Description:
 * @Author: dh
 * @Date: 2022-01-21 13:41:19
 * @LastEditors: dh
 * @LastEditTime: 2022-11-30 10:31:15
-->
<template>
	<div>{{ userInfo.name }}</div>
	<div>{{ userInfo.age }}</div>
	<button @click="change(userInfo)">子组件改变</button>
</template>

<script>
export default {
	inject: ['userInfo'],
	setup() {
		function change(data) {
			data.name = '123';
		}

		return { change };
	},
};
</script>
